package com.example.sjkks.mapper;

import com.example.sjkks.entity.Student;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StudentMapper {

    @Insert("INSERT INTO students (name, studentId, email, phone, grade, academicscore, politicalscore, researchscore, servicescore, totalscore) " +
            "VALUES (#{name}, #{studentId}, #{email}, #{phone}, #{grade}, #{academicScore}, #{politicalScore}, #{researchScore}, #{serviceScore}, #{totalScore})")
    void save(Student student);

    @Select("SELECT * FROM students")
    List<Student> findAll();
}
